import request from '@/utils/request'

const f = (url, params) => {
  return request({
    url: url,
    method: 'post',
    data: params || null
  })
}

export default {
  User: {
    Login: p => f('/auth', p),
    Logout: () => f('/logout'),
    Info: () => f('/u/info'),
    ChangePassword: p => f('/u/cpw', p),
    Add: p => f('/u/add', p),
    Edit: p => f('/u/edit', p),
    ResetPassword: p => f('/u/rpw', p),
    List: () => f('/u/list'),
    GetAuth: p => f('/u/ga', p),
    SetAuth: p => f('/u/sa', p),
    BaseInfo: () => f('/u/map')
  },
  Position: {
    Add: p => f('/p/add', p),
    Edit: p => f('/p/edit', p),
    List: () => f('/p/list1'),
    ListAuth: () => f('/p/list2'),
    Del: p => f('/p/del', p)
  },
  Resume: {
    Add: p => f('/r/add', p),
    Edit: p => f('/r/edit', p),
    Del: p => f('/r/del', p),
    List: p => f('/r/list1', p),
    ListNotEvaluated: p => f('/r/list2', p),
    ListByInterviewId: p => f('/r/list3', p),
    ExportResume: p => f('/r/export', p),
    Content: p => f('/r/content', p),
    Details: p => f('/r/detail', p),
    ChangeStatus: p => f('/r/cs', p),
    Statistics: p => f('/r/s', p)
  },
  Evaluate: {
    Add: p => f('/e/add', p),
    Edit: p => f('/e/edit', p)
  },
  Interview: {
    Add: p => f('/i/add', p),
    Edit: p => f('/i/edit', p),
    Del: p => f('/i/del', p),
    List: p => f('/i/list', p)
  },
  File: {
    Update: p => f('/f/update', p)
  }
}
